package com.epoint.mobileoa.bizlogic.mobileoa;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import android.os.Message;

import com.epoint.mobileoa.bizlogic.SuperView;
import com.epoint.mobileoa.bizlogic.Task;
import com.epoint.mobileoa.http.HttpHelp;

/**
 * @author liyc
 * @time 2012-2-22 上午2:22:48
 * @annotation 
 */
public class SendMailNoAttachTask extends Task {

	/**
	 * @param con
	 * @param param
	 */
	public SendMailNoAttachTask(SuperView con, HashMap<String, Object> param) {
		super(con, param);
		
	}

	@Override
	public void exectue(Message mess) throws Exception {
		
		String mailguid = UUID.randomUUID().toString();
		Map<String, String> mailmap = new HashMap<String, String>();
		mailmap.put("userguid", getCon().fp.getUserguid());
		mailmap.put("displayname", getCon().fp.getDisplayname());
		mailmap.put("mailguid", mailguid);
		mailmap.put("mailtitle", getParam().get("mailtitle").toString());
		mailmap.put("mailcontent", getParam().get("mailcontent").toString());
		mailmap.put("sjrnames", getParam().get("sjrnames").toString());
		mailmap.put("sjrguids", getParam().get("sjrguids").toString());
		mailmap.put("csrnames", getParam().get("csrnames").toString());
		mailmap.put("csrguids", getParam().get("csrguids").toString());
		
		String zfhasattach = getParam().get("zfhasattach")==null?"":getParam().get("zfhasattach").toString();
		
		String CliengGuid = getParam().get("CliengGuid")==null?"":getParam().get("CliengGuid").toString();
		
		if(zfhasattach.equals("1")){
			mailmap.put("hasattach", "1");
		}
		else{
			mailmap.put("hasattach", "0");
		}
		
		mailmap.put("zfmailguid", CliengGuid);
		
		
		String seamurl = getCon().fp.getSeamurl()+"?requestType=SendMailNoAttach";
		String bs = HttpHelp.post(seamurl, mailmap, null);
		setMessageToRefreshUI(mess,getCon(), bs);
	}

}
